package com.ganee.agora.viewmodel

import android.app.Application
import androidx.lifecycle.MutableLiveData
import com.ganee.agora.model.InsertActivityEntity
import com.ganee.agora.model.TicketInfoEntity
import com.ganee.agora.repository.*
import com.ganee.baselib.httprequest.callback.RequestCallback

import com.ganee.baselib.mvvmlibrary.base.BaseRepository
import com.ganee.baselib.mvvmlibrary.base.BaseViewModel
import okhttp3.RequestBody

class TicketDetailViewModel(application: Application) : BaseViewModel<TicketDetailRepository>(application) {

    var info = MutableLiveData<TicketInfoEntity>()

    override fun getRepository(): TicketDetailRepository {
        return TicketDetailRepository(this)
    }


    //获取票据信息
    fun getTicketInfo(body: RequestBody) {
        mRepository.getTicketInfo(body, RequestCallback<TicketInfoEntity> { entity ->
            info.value = entity
        })
    }
}
